IMPORTANT! <br>
If the database is updated, all data already in it will be REMOVED. Please do not do this unless you are sure of what you are doing. <br>
<br>

<script type="text/javascript">
<!--

var gen_counter = 0;
var exp_counter = 0;
var cli_counter = 0;

function init() {
	document.getElementById('btnMoreGenotypes').onclick = moreGenotypes;
        document.getElementById('btnMoreExpression').onclick = moreExpressions;
        document.getElementById('btnMoreClinical').onclick = moreClinical;
        moreGenotypes();
        moreExpressions();
        moreClinical();
}

function moreGenotypes() {
        if (gen_counter == 0)
        {
            document.getElementById('genotype').style.display = 'block';
            gen_counter++;
            return;
        }
	var newFields = document.getElementById('genotype').cloneNode(true);
	newFields.id = '';
	newFields.style.display = 'block';
	var newField = newFields.childNodes;
	for (var i=0;i<newField.length;i++) {
		var theName = newField[i].name
		if (theName)
			newField[i].name = theName + gen_counter;
	}
	var insertHere = document.getElementById('btnMoreGenotypes');
	insertHere.parentNode.insertBefore(newFields,insertHere);
        gen_counter++;
}

function moreExpressions() {
        if (exp_counter == 0)
        {
            document.getElementById('expression').style.display = 'block';
            exp_counter++;
            return;
        }
	var newFields = document.getElementById('expression').cloneNode(true);
	newFields.id = '';
	newFields.style.display = 'block';
	var newField = newFields.childNodes;
	for (var i=0;i<newField.length;i++) {
		var theName = newField[i].name
		if (theName)
			newField[i].name = theName + exp_counter;
	}
	var insertHere = document.getElementById('btnMoreExpression');
	insertHere.parentNode.insertBefore(newFields,insertHere);
        exp_counter++;
}

function moreClinical() {
        if (cli_counter == 0)
        {
            document.getElementById('clinical').style.display = 'block';
            cli_counter++;
            return;
        }
	var newFields = document.getElementById('clinical').cloneNode(true);
	newFields.id = '';
	newFields.style.display = 'block';
	var newField = newFields.childNodes;
	for (var i=0;i<newField.length;i++) {
		var theName = newField[i].name
		if (theName)
			newField[i].name = theName + cli_counter;
	}
	var insertHere = document.getElementById('btnMoreClinical');
	insertHere.parentNode.insertBefore(newFields,insertHere);
        cli_counter++;
}

window.onload = init;
// -->
</script>

<div id="upload_form">
    <form method="post" action="../PHP/upload.php" enctype="multipart/form-data">

    ----------------------------------------------------------------------- <br>
        <div id="genotype" style="display: none">

                Choose genotypes data file: <input name="gen_upload" type="file"/> <br>

        </div>
        <input type="button" id="btnMoreGenotypes" onclick="moreGenotypes();" value="Add more genotype data" /> <br>

    ----------------------------------------------------------------------- <br>
    ----------------------------------------------------------------------- <br>

        <div id="expression" style="display: none">

                Choose expression data file: <input name="exp_upload" type="file"/> <br>
                Choose annotation file: <input name="nameVsSymbol_upload" type="file"/> <br>
                Name tissue type: <input name="tissue_type" type="text"/> <br>

        </div>
        <input type="button" id="btnMoreExpression" onclick="moreExpressions();" value="Add more expression data" /> <br>

    ----------------------------------------------------------------------- <br>

        ----------------------------------------------------------------------- <br>

        <div id="clinical" style="display: none">

                Choose clinical data file: <input name="clinical_upload" type="file"/> <br>

        </div>
        <input type="button" id="btnMoreClinical" onclick="moreClinical();" value="Add more clinical data" /> <br>

            <span id="writeroot"></span>

    ----------------------------------------------------------------------- <br>

            <input type="submit" value="Upload"> <br>

    ----------------------------------------------------------------------- <br>

    </form>
</div>